﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class MsgBox : Form
    {
        public MsgBox()
        {
            InitializeComponent();
            this.Height = WH_BASIC;
        }


        const int WH_BASIC = 115;
        const int WH_DETAIL = 320;

        private void button3_Click(object sender, EventArgs e)
        {
            this.panel2.Visible = !this.panel2.Visible;
            this.Height = this.panel2.Visible ? WH_DETAIL : WH_BASIC;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void MsgBox_Load(object sender, EventArgs e)
        {
            try
            {
                throw new Exception("out line errot", new Exception("inner line error", new Exception("test")));
            }
            catch (Exception ex)
            {
                this.richTextBox1.Text = ex.ToString();
            }
        }

        private void toolStrip1_Paint(object sender, PaintEventArgs e)
        {
            if ((sender as ToolStrip).RenderMode == ToolStripRenderMode.System)
            {
                Rectangle rect = new Rectangle(0, 0, this.toolStrip1.Width, this.toolStrip1.Height - 2);
                e.Graphics.SetClip(rect);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //new Microsoft.SqlServer.MessageBox.ExceptionMessageBox(new Exception("efee")).Show(null);
        }
    }
}
